package com.teemo.equipment.controller;

import com.teemo.equipment.biz.RecommendBizService;
import com.teemo.equipment.domain.dto.EquipmentPageDTO;
import com.teemo.equipment.domain.dto.RecommendAddDTO;
import com.teemo.equipment.domain.dto.RecommendPageDTO;
import com.teemo.equipment.domain.vo.BasePageVO;
import com.teemo.equipment.domain.vo.EquipmentPageVO;
import com.teemo.equipment.domain.vo.RecommendVO;
import com.teemo.equipment.domain.vo.ResultVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.annotation.Resource;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author Teemo
 */
@RestController
@RequestMapping("/recommend")
public class RecommendController {

    @Resource
    private RecommendBizService recommendBizService;

    @PostMapping("/add")
    public ResultVO<Boolean> add(@RequestBody @Validated RecommendAddDTO dto){
        Boolean success=  recommendBizService.add(dto);
        return ResultVO.success(success);
    }

    @GetMapping("/page")
    @Operation(summary = "推荐出装分页查询")
    @ApiResponse(description = "推荐出装分页查询")
    public ResultVO<BasePageVO<RecommendVO>> page(@ParameterObject RecommendPageDTO dto){
        BasePageVO<RecommendVO> page=  recommendBizService.page(dto);
        return ResultVO.success(page);
    }

}
